/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_build_building.h

	$Header: /heroes4/script_build_building.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_BUILD_BUILDING_H_INCLUDED )
#define SCRIPT_BUILD_BUILDING_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_script_action.h"
#include "script_action_type.h"

enum t_town_building;

// --------------------------------------------------------------------------
// t_script_build_building class
// --------------------------------------------------------------------------

class t_script_build_building : public t_abstract_script_action
{
public:
	// Constructor
	t_script_build_building();

	// Member functions
	virtual void	execute(t_script_context_hero const& context) const;
	virtual void	execute(t_script_context_town const& context) const;
	virtual void	execute(t_script_context_object const& context) const;
	virtual void	execute(t_script_context_army const& context) const;
	virtual void	execute(t_script_context_global const& context) const;

	t_town_building	get_building() const;
	virtual bool	read(
						std::streambuf &	stream,
						int					version );
	virtual bool	read_from_map(
						std::streambuf &	stream,
						int					format_version );
	virtual bool	write( std::streambuf & stream ) const;

private:
	// Data members
	t_town_building	m_building;
};

// --------------------------------------------------------------------------
// t_script_build_building inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_script_build_building::t_script_build_building()
	:	m_building( t_town_building( 0 ) )
{
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_town_building t_script_build_building::get_building() const
{
	return m_building;
}

SPECIALIZE_SCRIPT_ACTION( k_script_action_build_building, t_script_build_building );

#endif // !defined( SCRIPT_BUILD_BUILDING_H_INCLUDED )
